Skip to content

Conversation

@macladson
Copy link
Member

Issue Addressed

Currently, consensus/types cannot build with no-default-features since we use "legacy" standard arithmetic operations.

Proposed Changes

  • Remove the offending arithmetic to fix compilation.
  • Rename legacy-arith to saturating-arith and disable it by default.

Additional Info

We could consider removing support for standard arithmetic entirely, although I think having an opt-in feature which makes the dangers of enabling it clear is an okay solution for now, and won't break any external users (and our own state_processing crate).

Incidentally, the ergonomics around using explicit methods such as saturating_add with integer types (which is available even without saturating-arith) is a bit awkward, since it requires casting to u64 first.

@macladson macladson added ready-for-review The code is ready for review code-quality labels Jan 22, 2026
Copy link
Member

@pawanjay176 pawanjay176 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, but it would be good if someone else can also take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality ready-for-review The code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants